<template>
	<z-paging
		ref="paging"
		:refresher-out-rate="0.8"
		:show-empty-view-reload-when-error="false"
		:empty-view-img-style="{ width: '308rpx', height: '308rpx' }"
		empty-view-error-img="https://oneredhealth.oss-cn-hangzhou.aliyuncs.com/2023/10/12/1c53b8aed0c74201bb092265803a1d48.png"
		empty-view-img="https://oneredhealth.oss-cn-hangzhou.aliyuncs.com/2023/10/12/987eadb1d50949a0a7e25dbbd99abe30.png"
		empty-view-error-text="暂无数据"
		safe-area-inset-bottom
		v-model="dataList"
		@query="queryList"
	>
		<view class="receive">
			<view
				class="receive_info"
				v-for="(item, index) in dataList"
				:key="index"
				@click="to_detail(item)"
			>
				<view class="info_time">
					<u-text :text="item.customerName" color="#3D3D3D" size="32rpx"
						iconStyle="margin-right:16rpx;width:60rpx;height:60rpx"
						prefixIcon="/static/img/conference/MissingAvatar.png" 
					/>
					<u--text
						:text="item.status ? '已完成' : '预约中'"
						:color="item.status ? '#6ACE7A' : '#E03918'"
						iconStyle="margin-left:8rpx;"
						suffixIcon="arrow-right"
						size="28rpx"
						align="right"
					/>
				</view>
				<view class="receive_detail">
					<view class="flex_wrap row_between">
						<u--text
							text="解读时间："
							color="#777777"
							size="28rpx"
						/>
						<u--text
							:text="item.status == 0 ? item.appointmentTime : item.interpretationTime"
							color="#777777"
							size="28rpx"
							align="right"
						/>
					</view>
					<u-gap height="26rpx" />
					<view class="flex_wrap row_between">
						<u--text
							text="解读人："
							color="#777777"
							size="28rpx"
						/>
						<u--text
							:text="item.doctorName"
							color="#777777"
							size="28rpx"
							align="right"
						/>
					</view>
				</view>
			</view>
		</view>
	</z-paging>
</template>

<script>
	import { listConventionInterpretationReport } from "@/api/cardSalesman"
	import { mapGetters } from "vuex"
	export default {
		data() {
			return {
				dataList: [],
				readRecordId:''
			}
		},
		computed: {
			...mapGetters(["isLogin", "phone"])
		},
		methods: {
			to_detail(item) {
				const data = JSON.stringify(item);
				this.$u.route({
				    url: "/pages_my1/unscramble/detail",
				    params: {
				        data,
				    },
				});
			},
			queryList(pageNo, pageSize) {
				const that = this
				const params = {
					pageNum: pageNo,
					pageSize: pageSize
				}
				listConventionInterpretationReport(params)
					.then((result) => {
						that.$refs.paging.completeByTotal(result.data.rows)
					})
					.catch((e) => {
						that.$refs.paging.complete(false)
					})
			},
		}
	}
</script>

<style lang="scss">
	.receive {
		width: 100%;
		color: #333333;
		padding: 32rpx 32rpx 0;
	}
	.receive_info {
		background: #ffffff;
		border-radius: 12rpx;
		font-size: 28rpx;
		margin-bottom: 32rpx;
		font-weight: bold;
	}
	.info_time {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 32rpx 32rpx 26rpx 32rpx;
	}
	.receive_detail {
		border-top: 2rpx solid rgba(243, 243, 243, 0.7);
		padding: 26rpx 32rpx;
	}
</style>
